<template>
  <div id="app">
    <div style="width: 35%;height: 850px;margin-right: 10px">
      <div style="width: 100%;height: 850px">
        <el-row :gutter="8">
          <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" v-for="(item, index) in plotList" :key="index">
            <el-card style="width: 525px;height: 850px">
              <span style="margin-bottom: 20px"><image-preview :src="item.plotPic" :width="480" :height="300"/></span>
              <h3 style="color: #2f54eb">{{item.plotName}}</h3>
              <p>小区地址：{{item.address}}</p>
              <p>所属辖区：<span style="color: #1c84c6">{{item.areasName}}</span></p>
              <div style="width: 480px;height: 60px;margin-top: 10px;margin-bottom: 20px">
                <div style="width: 80px;height: 60px;margin-left: 40px">
                  <h1>楼栋</h1>
                  <p><span style="color: chocolate;margin-right: 15px">0</span>栋</p>
                </div>
                <div style="width: 80px;height: 60px;margin-left: 180px;margin-top: -80px">
                  <h1>住户</h1>
                  <p><span style="color: chocolate;margin-right: 15px">0</span>户</p>
                </div>
                <div style="width: 100px;height: 60px;margin-left: 320px;margin-top: -80px">
                  <h1>实有人口</h1>
                  <p><span style="color: chocolate;margin-right: 15px">{{residentTotal}}</span>人</p>
                </div>
              </div>
              <hr>
              <div style="width: 100%;height: 250px;">
                <div style="height: 30px;width: 100%;margin-bottom: 10px" @click="selectiveNumber(1)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUqiAAKi2AAAMeb7RxNk814.png" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有人口 <span style="margin-left: 300px">{{ item.actualPopulation }}</span></div>
                </div>
                <div style="height: 30px;width: 100%;margin-bottom: 10px" @click="selectiveNumber(2)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUreANwPXAAAOxg4Atno663.png" alt="" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有房屋 <span style="margin-left: 300px">{{ item.buildingNum }}</span></div>
                </div>
                <div style="height: 30px;width: 100%;margin-bottom: 10px" @click="selectiveNumber(3)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUuKAKTXmAAAQq0QNH9w455.png" alt="" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有单位 <span style="margin-left: 300px">{{ item.actualUnit }}</span></div>
                </div>
                <div style="height: 30px;width: 100%;margin-bottom: 10px" @click="selectiveNumber(4)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUpOAPxS-AAAMjIioBVk715.png" alt="" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有车辆 <span style="margin-left: 300px">{{ item.actualVehicle }}</span></div>
                </div>
                <div style="height: 30px;width: 100%;margin-bottom: 10px" @click="selectiveNumber(5)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUFeAC5moAAAJEJdSgTQ894.png" alt="" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有力量 <span style="margin-left: 300px">{{0 }}</span></div>
                </div>
                <div style="height: 30px;width: 100%" @click="selectiveNumber(6)">
                  <img src="http://106.54.196.142:8888/group1/M00/00/08/CgAEBmaoUsWAcNaDAAAKasWgl3E360.png" alt="" width="30px" height="30px">
                  <div style="margin-left: 33px;margin-top: -30px">实有设备 <span style="margin-left: 300px">{{ item.actualEquipment }}</span></div>
                </div>
              </div>

            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>

    <div style="width: 64%;height: 850px;margin-left: 36.5%;margin-top: -850px;margin-right: 10px">
      <div v-show="this.params==1">
        <div class="custom-icon-text" style="margin-top: -15px">
          <div class="search-form" style="width: 100%">
            <div style="width: 60px;height: 60px;margin-left: 0px;margin-top: 0px"><el-button icon="el-icon-s-data" class="custom-button">总数<br><br>{{residentTotal}}</el-button></div>
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" style="margin-top: 10px" label-width="68px">
              <div style=" border-bottom: 1px solid #333;margin-bottom: 10px">
                <div style="margin-left: 100px;margin-top: -60px">
                  <el-form-item prop="residentTypeId">
                    <el-input
                      style="width: 250px"
                      v-model="queryParams.resident"
                      placeholder="请输入姓名、证件号、手机号"
                      clearable
                    />
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" icon="el-icon-search" style="margin-left: -11px"  @click="residentHandleQuery"></el-button>
                    <el-button icon="el-icon-refresh" size="mini"@click="advancedSearch" >高级检索</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="residentResetQuery">重置条件</el-button>
                  </el-form-item>
                </div>
              </div>
              <div v-if="isAdvancedSearch" style="width: 100%;margin-top: 5px ">
                <el-form-item label="人员类型" prop="residentTypeId">
                  <el-select v-model="queryParams.residentTypeId" placeholder="全部" clearable>
                    <el-option
                      v-for="dict in dict.type.personnel_category"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    />
                  </el-select>
                </el-form-item>
<!--                <el-form-item label="小区名称" prop="plotId">-->
<!--                  <el-select v-model="queryParams.plotId" placeholder="请选择小区" clearable>-->
<!--                    <el-option v-for="i in plotList" :key="i.id" :label="i.plotName" :value="i.id"></el-option>-->
<!--                  </el-select>-->
<!--                </el-form-item>-->
                <el-form-item label="身份标签" prop="identityTag">
                  <el-input
                    v-model="queryParams.identityTag"
                    placeholder="请输入身份标签"
                    clearable
                  />
                </el-form-item>
                <el-form-item label="户籍地址" prop="householdAddress">
                  <el-input
                    v-model="queryParams.householdAddress"
                    placeholder="请输入户籍地址"
                    clearable
                  />
                </el-form-item>
                <el-form-item label="年龄段" prop="householdAddress">
                  <el-input style="width: 105px" v-model="queryParams.minAge" clearable placeholder="最小年龄"/>
                  <el-input style="width: 105px" v-model="queryParams.maxAge" clearable placeholder="最大年龄"/>
                </el-form-item>
                <el-form-item label="性别">
                  <el-radio-group v-model="queryParams.gender">
                    <el-radio v-for="dict in dict.type.sys_user_sex"
                              :key="dict.value"
                              :label="dict.label"
                              :value="dict.value">
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
              </div>
            </el-form>
          </div>
        </div>

        <el-table border v-loading="loading" :data="residentsList">
          <el-table-column label="编号" width="50">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.$index+1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="人脸照片" align="center" prop="faceImage" width="100">
            <template slot-scope="scope">
              <image-preview :src="scope.row.faceImage" :width="50" :height="50"/>
            </template>
          </el-table-column>
          <el-table-column label="姓名" align="center" prop="name" />
          <el-table-column label="性别" align="center" prop="gender" />
          <el-table-column width="140" label="证件号" align="center" prop="idNumber" />
          <el-table-column width="110" label="电话号码" align="center" prop="phoneNumber" />
          <el-table-column style="text-align: center" label="人员类型" width="80">
            <template slot-scope="scope">
              <span style="text-align: center" v-if="scope.row.residentTypeId==1">户籍人员</span>
              <span style="text-align: center" v-if="scope.row.residentTypeId==2">外来人员</span>
              <span style="text-align: center" v-if="scope.row.residentTypeId==3">境外人员</span>
            </template>
          </el-table-column>
          <el-table-column label="小区名称" align="center" prop="plotName" />
          <el-table-column label="身份标签" align="center" prop="identityTag" />
          <el-table-column label="户籍地址" align="center" prop="householdAddress" />
          <el-table-column style="text-align: center" label="迁入迁出状态" width="100">
            <template slot-scope="scope">
              <span style="display: inline-block; text-align: center; width: 100%;" v-if="scope.row.migrationStatus==1">迁入</span>
              <span style="display: inline-block; text-align: center; width: 100%;" v-if="scope.row.migrationStatus==2">迁出</span>
              <span style="display: inline-block; text-align: center; width: 100%;" v-if="scope.row.migrationStatus==3">常住</span>
            </template>
          </el-table-column>
          <el-table-column label="最后出现时间" align="center" prop="lastSeen" width="180">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.lastSeen, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="residentTotal>0"
          :total="residentTotal"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getResidentList"
        />
      </div>
      <div v-show="this.params==2">
        <div class="custom-icon-text" style="margin-top: -15px">
          <div class="search-form" style="width: 100%">
            <div style="width: 60px;height: 60px;margin-left: 0px;margin-top: 0px">
              <el-button icon="el-icon-s-data" class="custom-button">总数<br><br>{{estateTotal}}</el-button>
            </div>
            <div style="width: 1100px;height: 60px;margin-left: 60px;margin-top: -60px">
              <el-form :model="estateParams" ref="queryForm" size="small" :inline="true" label-width="68px">
                <el-form-item label="楼栋" prop="buildingsId">
                  <el-input
                    v-model="estateParams.buildingsId"
                    placeholder="楼栋"
                    clearable
                    style="width: 130px"
                  />
                </el-form-item>
                <el-form-item label="房间号" prop="roomNumber">
                  <el-input
                    v-model="estateParams.roomNumber"
                    placeholder="请输入房间号"
                    clearable
                    style="width: 130px"
                  />
                </el-form-item>
                <el-form-item label="房屋类型" prop="roomTypeId">
                  <el-select v-model="estateParams.roomTypeId" placeholder="全部" clearable>
                    <el-option
                      v-for="dict in dict.type.estate_type"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" icon="el-icon-search" size="mini" @click="estateHandleQuery">搜索</el-button>
                  <el-button icon="el-icon-refresh" size="mini" @click="estateResetQuery">重置</el-button>
                </el-form-item>
              </el-form>
            </div>
          </div>
        </div>
        <hr>

        <el-table border v-loading="loading" :data="estateList">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="编号" width="50">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.$index+1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="小区名称" align="center" prop="plotName" />
          <el-table-column label="楼栋" align="center" prop="buildingsId" />
          <el-table-column label="单元" align="center" prop="unitsId" />
          <el-table-column label="楼层" align="center" prop="floorsId" />
          <el-table-column label="房间号" align="center" prop="roomNumber" />
          <el-table-column label="房屋类型" align="center" prop="roomTypeName" />
          <el-table-column label="档案" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                @click="personFile(scope.row)"
              >一屋一档</el-button>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['system:estate:edit']"
              >修改</el-button>
              <!--          <el-button-->
              <!--            size="mini"-->
              <!--            type="text"-->
              <!--            icon="el-icon-delete"-->
              <!--            @click="handleDelete(scope.row)"-->
              <!--            v-hasPermi="['system:estate:remove']"-->
              <!--          >删除</el-button>-->
            </template>
          </el-table-column>
        </el-table>

        <div class="block">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="estateParams.pageNum"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="estateParams.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="estateTotal">
          </el-pagination>
        </div>
      </div>
      <div v-show="this.params==3">
        <div class="custom-icon-text" style="margin-top: -15px">
          <div class="search-form" style="width: 100%">
            <div style="width: 60px;height: 60px;margin-left: 10px;margin-top: 0px">
              <el-button icon="el-icon-s-data" class="custom-button">总数<br><br>{{unitsTotal}}</el-button>
            </div>
            <el-form :model="unitsParams" ref="queryForm" size="small" :inline="true" style="margin-top: 10px" label-width="68px">
              <div style=" border-bottom: 1px solid #333;margin-bottom: 10px">
                <div style="margin-left: 100px;margin-top: -60px">
                  <el-form-item>
                    <el-input v-model="unitsParams.unitParams" style="width: 220px" clearable placeholder="请输入单位名称/地址"></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" icon="el-icon-search" style="margin-left: -11px"  @click="unitHandleQuery"></el-button>
                    <el-button icon="el-icon-refresh" size="mini"@click="advancedSearch">高级检索</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="unitResetQuery">重置条件</el-button>
                  </el-form-item>
                </div>
              </div>
              <div v-if="isAdvancedSearch" style="width: 100%;margin-top: 5px">
                <el-form-item label="所属辖区">
                  <el-cascader
                    v-model="areasIds"
                    clearable
                    :options="areasList"
                    :props="{ expandTrigger: 'click' ,value: 'id', label: 'name', children: 'childrenList'}"
                    @change="aressChange">
                  </el-cascader>
                </el-form-item>
<!--                <el-form-item label="小区名称" prop="plotId">-->
<!--                  <el-select v-model="unitsParams.plotId" placeholder="请选择小区" clearable>-->
<!--                    <el-option v-for="i in plotList" :key="i.id" :label="i.plotName" :value="i.id"></el-option>-->
<!--                  </el-select>-->
<!--                </el-form-item>-->
              </div>
            </el-form>
          </div>
        </div>

        <el-table border v-loading="loading" :data="unitsList">
          <el-table-column label="编号" width="50">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.$index+1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="单位图片" align="center" prop="unitPicture" width="100">
            <template slot-scope="scope">
              <image-preview :src="scope.row.unitPicture" :width="50" :height="50"/>
            </template>
          </el-table-column>
          <el-table-column label="单位名称" align="center" prop="unitName" />
          <el-table-column label="类别名称" align="center" prop="categoryName" />
          <el-table-column label="小区名称" align="center" prop="plotName" />
          <el-table-column label="单位地址" align="center" prop="unitAddress" />
          <el-table-column label="所属辖区" align="center" prop="areasName" />
          <el-table-column label="从业人员数量" align="center" prop="staffCount" />
          <el-table-column label="联系人姓名" align="center" prop="contactPerson" />
          <el-table-column label="联系电话" align="center" prop="contactPhone" />
          <el-table-column label="证件号码" align="center" prop="idNumber" />
          <el-table-column label="单位坐标点" align="center" prop="locationCoordinates" />
        </el-table>

        <pagination
          v-show="unitsTotal>0"
          :total="unitsTotal"
          :page.sync="unitsParams.pageNum"
          :limit.sync="unitsParams.pageSize"
          @pagination="getUnitsList"
        />
      </div>
      <div v-show="this.params==4">
        <div class="custom-icon-text" style="margin-top: -15px">
          <div class="search-form" style="width: 100%">
            <div style="width: 60px;height: 60px;margin-left: 10px;margin-top: 0px">
              <el-button icon="el-icon-s-data" class="custom-button">总数<br><br>{{vehicleTotal}}</el-button>
            </div>
            <el-form :model="vehicleParam" ref="queryForm" size="small" :inline="true" style="margin-top: 10px" label-width="68px">
              <div style=" border-bottom: 1px solid #333;margin-bottom: 10px">
                <div style="margin-left: 100px;margin-top: -60px">
                  <el-form-item>
                    <el-input v-model="vehicleParam.vehicleParams" style="width: 220px" clearable placeholder="请输入车牌号、姓名、证件号"></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" icon="el-icon-search" style="margin-left: -11px"  @click="vehicleHandleQuery"></el-button>
                    <el-button icon="el-icon-refresh" size="mini"@click="advancedSearch">高级检索</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="vehicleResetQuery">重置条件</el-button>
                  </el-form-item>
                </div>
              </div>
              <div v-if="isAdvancedSearch" style="width: 100%;margin-top: 5px">
                <el-form-item label="所属辖区">
                  <el-cascader
                    v-model="areasIds"
                    clearable
                    :options="areasList"
                    :props="{ expandTrigger: 'click' ,value: 'id', label: 'name', children: 'childrenList'}"
                    @change="aresChange">
                  </el-cascader>
                </el-form-item>
<!--                <el-form-item label="小区名称" prop="plotId">-->
<!--                  <el-select v-model="vehicleParam.plotId" placeholder="请选择小区" clearable>-->
<!--                    <el-option v-for="i in plotList" :key="i.id" :label="i.plotName" :value="i.id"></el-option>-->
<!--                  </el-select>-->
<!--                </el-form-item>-->
              </div>
            </el-form>
          </div>
        </div>

        <el-table border v-loading="loading" :data="vehiclesList">
          <el-table-column label="编号" width="50">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.$index+1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="车辆照片" align="center" prop="vehiclePhotoUrl" width="100">
            <template slot-scope="scope">
              <image-preview :src="scope.row.vehiclePhotoUrl" :width="50" :height="50"/>
            </template>
          </el-table-column>
          <el-table-column label="车牌号码" align="center" prop="licensePlate" />
          <el-table-column label="车主名称" align="center" prop="name" />
          <el-table-column label="小区名称" align="center" prop="plotName" />
          <el-table-column label="证件号" align="center" prop="idNumber" />
          <el-table-column label="辖区" align="center" prop="areasName" />
        </el-table>

        <pagination
          v-show="vehicleTotal>0"
          :total="vehicleTotal"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getVehicleList"
        />
      </div>
      <div v-show="this.params==5">暂未开发</div>
      <div v-show="this.params==6">
        <div class="custom-icon-text" style="margin-top: -15px">
          <div class="search-form" style="width: 100%">
            <div style="width: 60px;height: 60px;margin-left: 0px;margin-top: 0px"><el-button icon="el-icon-s-data" class="custom-button">总数<br><br>{{devicesTotal}}</el-button></div>
            <el-form :model="devicesParams" ref="queryForm" size="small" :inline="true" style="margin-top: 10px" label-width="68px">
              <div style=" border-bottom: 1px solid #333;margin-bottom: 10px">
                <div style="margin-left: 60px;margin-top: -60px">
                  <el-form :model="devicesParams" ref="queryForm" size="small" :inline="true" label-width="68px">
                    <el-form-item label="关键字" prop="deviceName">
                      <el-input
                        v-model="devicesParams.deviceName"
                        placeholder="请输入设备名称"
                        clearable
                      />
                    </el-form-item>
                    <el-form-item label="设备类型" prop="residentTypeId">
                      <el-select v-model="devicesParams.deviceType" placeholder="全部" clearable>
                        <el-option
                          v-for="dict in dict.type.device_type"
                          :key="dict.value"
                          :label="dict.label"
                          :value="dict.value"
                        />
                      </el-select>
                    </el-form-item>
                    <el-form-item label="所属辖区">
                      <el-cascader
                        v-model="areasIds"
                        clearable
                        :options="areasList"
                        :props="{ expandTrigger: 'click' ,value: 'id', label: 'name', children: 'childrenList'}"
                        @change="aresChange">
                      </el-cascader>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" icon="el-icon-search" style="margin-left: -11px"  @click="deviceHandleQuery"></el-button>
                      <el-button icon="el-icon-refresh" size="mini" @click="deviceResetQuery">重置条件</el-button>
                    </el-form-item>
                  </el-form>
                </div>
              </div>
            </el-form>
          </div>
        </div>

        <el-table v-loading="loading" :data="devicesList">
          <el-table-column label="编号" width="50">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.$index+1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="设备名称" align="center" prop="deviceName" />
          <el-table-column label="设备类型" align="center" prop="deviceType" />
          <el-table-column label="设备状态/细节" align="center" prop="operationDetails" />
          <el-table-column label="小区名称" align="center" prop="plotName" />
          <el-table-column label="所属辖区" align="center" prop="areasName" />
          <el-table-column label="设备唯一标识" align="center" prop="deviceMac" />
        </el-table>

        <pagination
          v-show="devicesTotal>0"
          :total="devicesTotal"
          :page.sync="devicesParams.pageNum"
          :limit.sync="devicesParams.pageSize"
          @pagination="getDevicesList"
        />
      </div>
    </div>
  </div>
</template>

<script>
import {listPlots, plotList} from "@/api/system/smart/plot";
import {listResidents} from "@/api/system/residents";
import {listVehicles} from "@/api/system/vehicles";
import {listUnits} from "@/api/system/units";
import {listDevices} from "@/api/system/devices";
import {listEstate} from "@/api/system/smart/estate";

export default {
  name: 'App',
  dicts: ['personnel_category','sys_user_sex','device_type','estate_type'],
  data() {
    return {
      // 遮罩层
      loading: true,
      user:{},
      params: 1,
      areasIds: [],
      areasList: {},

      // 小区列表
      plotList: [],
      // 车辆列表
      vehiclesList: [],
      // 人口列表
      residentsList: [],
      // 单位列表
      unitsList: [],
      // 设备列表
      devicesList: [],
      // 实有房屋
      estateList: [],
      // 列表参数
      devicesParams: {
        pageNum: 1,
        pageSize: 10,
        deviceName: '',
        deviceType: '',
        plotId: '',
        areasId: ''
      },
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        id: '',
        resident: '',
        residentTypeId: '',
        plotId: '',
        identityTag: '',
        householdAddress: '',
        minAge: '',
        maxAge: ''
      },
      formInline: {
        pageNum: 1,
        pageSize: 1,
        id: '',
        userId: ''
      },
      vehicleParam: {
        pageNum: 1,
        pageSize: 10,
        vehicleParams: '',
        plotId: '',
        areasId: ''
      },
      unitsParams: {
        pageNum: 1,
        pageSize: 10,
        unitParams: '',
        areasId: '',
        plotId: ''
      },
      estateParams: {
        pageNum: 1,
        pageSize: 10,
        plotId: ''
      },
      // 六实数量
      residentTotal: '',
      vehicleTotal: '',
      unitsTotal: '',
      devicesTotal: '',
      estateTotal: '',
      // 高级检索
      isAdvancedSearch: false,
    };
  },
  created() {
    this.formInline.id = this.$route.query.id;
    this.queryParams.plotId = this.$route.query.id;
    this.vehicleParam.plotId = this.$route.query.id;
    this.unitsParams.plotId = this.$route.query.id;
    this.devicesParams.plotId = this.$route.query.id;
    this.estateParams.plotId = this.$route.query.id;
    this.user = JSON.parse(sessionStorage.getItem('user'))
    this.getPlotList()
    this.getResidentList()
    this.getVehicleList()
    this.getUnitsList()
    this.getDevicesList()
    this.getEstateList()
  },
  mounted() {},
  methods: {
    /** 房屋搜索按钮操作 */
    estateHandleQuery() {
      this.getEstateList();
    },
    /** 房屋重置按钮操作 */
    estateResetQuery() {
      this.estateParams = {};
      this.getEstateList();
    },
    /** 实有房屋分页 */
    handleSizeChange(val) {
      this.estateParams.pageSize = val
      console.log(`每页 ${val} 条`);
      this.getEstateList();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.estateParams.pageNum = val
      this.getEstateList();
    },

    /** 查询实有房屋列表 */
    getEstateList() {
      this.loading = true;
      listEstate(this.queryParams).then(response => {
        console.log(response)
        this.estateList = response.data.list;
        this.estateTotal = response.data.total;
        this.loading = false;
      });
    },
    /** 查询设备列表 */
    getDevicesList() {
      this.loading = true;
      listDevices(this.devicesParams).then(response => {
        this.devicesList = response.data.rows;
        this.devicesTotal = response.data.total;
        this.loading = false;
      });
    },
    /** 查询小区列表 */
    getPlotList() {
      this.formInline.userId = this.user.userId
      plotList(this.formInline).then(res => {
        this.plotList = res.data.rows;
        this.total = res.data.total;
      })
    },
    /** 查询实有人口列表 */
    getResidentList() {
      this.loading = true;
      listResidents(this.queryParams).then(response => {
        this.residentsList = response.data.rows;
        this.residentTotal = response.data.total;
        this.loading = false;
      });
    },
    /** 查询实有车辆列表 */
    getVehicleList() {
      this.loading = true;
      listVehicles(this.vehicleParam).then(response => {
        console.log(response)
        this.vehiclesList = response.data.rows;
        this.vehicleTotal = response.data.total;
        this.loading = false;
      });
    },
    /** 查询实有单位列表 */
    getUnitsList() {
      this.loading = true;
      listUnits(this.unitsParams).then(response => {
        this.unitsList = response.data.rows;
        this.unitsTotal = response.data.total;
        this.loading = false;
      });
    },
    /** 搜索实有车辆按钮操作 */
    vehicleHandleQuery (){
      this.getVehicleList()
    },
    /** 重置实有车辆按钮操作 */
    vehicleResetQuery (){
      this.vehicleParam = {}
      this.vehicleParam.pageNum = 1;
      this.vehicleParam.pageSize= 10;
      this.vehicleParam.plotId= this.$route.query.id;
      this.getVehicleList();
    },
    /** 搜索实有人口按钮操作 */
    residentHandleQuery() {
      this.getResidentList();
    },
    /** 重置实有人口按钮操作 */
    residentResetQuery() {
      this.queryParams = {}
      this.queryParams.pageNum = 1
      this.queryParams.pageSize = 10
      this.queryParams.plotId = this.$route.query.id;
      this.getResidentList();
    },
    /** 搜索实有设备按钮操作 */
    deviceHandleQuery() {
      this.getDevicesList();
    },
    /** 重置实有设备按钮操作 */
    deviceResetQuery() {
      this.devicesParams = {}
      this.devicesParams.pageNum = 1
      this.devicesParams.pageSize = 10
      this.devicesParams.plotId = this.$route.query.id;
      this.getDevicesList();
    },
    /** 搜索实有单位按钮操作 */
    unitHandleQuery() {
      this.getUnitsList();
    },
    /** 重置实有单位按钮操作 */
    unitResetQuery() {
      this.unitsParams = {}
      this.unitsParams.pageNum = 1
      this.unitsParams.pageSize = 10
      this.unitsParams.plotId = this.$route.query.id;
      this.getUnitsList();
    },
    /**
     *  高级检索
     */
    advancedSearch() {
      if (this.isAdvancedSearch == true){
        this.isAdvancedSearch = false
      }else if (this.isAdvancedSearch == false){
        this.isAdvancedSearch = true
      }
    },
    /** 行政区划改变 */
    aresChange() {
      this.vehicleParam.areasId = this.areasIds[this.areasIds.length - 1]
      this.unitsParams.areasId = this.areasIds[this.areasIds.length - 1]
      this.devicesParams.areasId = this.areasIds[this.areasIds.length - 1]
    },
    selectiveNumber(number) {
      this.params = number
    }
  },
  watch: {

  },
};
</script>

<style>
.custom-button {
  border: none; /* 移除边框 */
  background-color: transparent; /* 移除背景色 */
  color: inherit; /* 继承父元素颜色 */
  padding: 0; /* 移除内边距 */
}

.custom-button .el-icon-s-data {
  display: none; /* 隐藏图标 */
}

.custom-button span {
  font-size: 14px; /* 调整字体大小 */
}
</style>
